<?php
$year = $this->Semester['year'];
$semester = $this->Semester['semester'];
$semesterClass = new Semester_Model_SemesterClass();
// 班級陣列
$className = $semesterClass->getClassNames($year,$semester);
 $text = new Default_Model_SystemText();
 // 身分別陣列
 $textOptions = $text->getKindArray('stud_kind');
?>"<?php echo $this->translate('student character')?>","<?php echo $this->translate('student id')?>","<?php echo $this->translate('class name')?>","<?php echo $this->translate('number')?>","<?php echo $this->translate('student name')?>","<?php echo $this->translate('student sex')?>","<?php echo $this->translate('dentification_number')?>","<?php echo $this->translate('birthday')?>","<?php echo $this->translate('address')?>","<?php echo $this->translate('home phone')?>","<?php echo $this->translate('father')?>","<?php echo $this->translate('mother')?>","<?php echo $this->translate('guardian')?>"
<?php foreach ($this->data as $val):?>
"<?php echo $textOptions[$val['kind']]?>","<?php echo $val['student_id']?>","<?php echo $className[$val['grade'].'-'.$val['class_sn']]?>","<?php echo $val['number']?>","<?php echo $val['name']?>","<?php if($val['sex']=='M') echo $this->translate('boy') ;else echo $this->translate('girl')?>","<?php echo $val['identification_number']?>","<?php echo $val['birthday']?>","<?php echo $val['address']?>","<?php echo $val['phone_home']?>
<?php
$arr =array();
foreach($val['Student_Model_StudentParents'] as $parents)
$arr[$parents['sex']] = $parents['name'];
?>","<?php if(isset($arr['M']))echo $arr['M']?>","<?php if(isset($arr['F']))echo $arr['F']?>","<?php echo $val['guardian_name']?>"
<?php endforeach?>